import request from '@/utils/request.js'

/**
 *  搜索关键字联想
 * @param {*} keywords 请求的前缀词句
 */
export const getSuggestion = (keywords) => {
  return request({
    method: 'GET',
    url: '/app/v1_0/suggestion',
    params: {
      q: keywords
    }
  })
}

/**
 *  获取查询结果
 * @param {*} keywords 关键字
 * @param {*} page 页码
 */
export const getSearchResult = (keywords, page) => {
  return request({
    method: 'GET',
    url: '/app/v1_0/search',
    params: {
      q: keywords,
      page
    }
  })
}
